#pragma once

#include "Node.h"

namespace mgfx
{
	class MeshInstance;
}

namespace mscene
{
	class ModelNode : public Node
	{
	public:
		enum PrimitiveType
		{
			BOX, SPHERE, PLANE, OTHER
		} PrimType;

		ModelNode(Scene & scene, PrimitiveType type, const char * name = NULL);
		ModelNode(const ModelNode & src);
		virtual ~ModelNode();
		virtual ModelNode* copy();

		virtual void update(float dt);

		virtual float rayIntersection(const mmath::Ray & ray);

		void setModel(mgfx::MeshInstance & model);
		const mgfx::MeshInstance & getModel() const;
		mgfx::MeshInstance & getModelEditable();

	private:
		mgfx::MeshInstance * mModel;
		uint mModelId;

	};
}